<!--
 * @Description: 
 * @Author: wgy
 * @CreateTime: 2022-12-17 19:42:35
 * @UpdateTime: 2022-12-17 19:47:44
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .title {
            color: red;
        }
    </style>
</head>

<body>
    <!-- 定义一个容器 -->
    <div id="box"></div>

    <!-- 引入react核心库 -->
    <script type="text/javascript" src="../js/react.development.js"></script>
    <!-- 引入react-domm库 用于操作dom -->
    <script type="text/javascript" src="../js/react-dom.development.js"></script>
    <!-- 引入babel,用于将jsx转换为js -->
    <script type="text/javascript" src="../js/babel.min.js"></script>

    <script type="text/babel">
        const arr = ["vue", "react", "auglus"]
        // 创建虚拟dom
        const VDOM = (
            <div>
                <h1 className="title">前端流行框架</h1>
                <ul>
                    {
                        arr.map((item, index) => {
                            return <li key={index}>{item}</li>
                        })
                    }
                </ul>
            </div>
        )

        /*
            react会自动遍历渲染数组，但是不会自动渲染对象
         */
        // 渲染元素
        ReactDOM.render(VDOM, document.getElementById("box"))
    </script>

</body>

</html>